extends ../layout

block content
    .container
        .row
            form.form-horizotal(method="post",action="/admin/movie",enctype="multipart/form-data")
                .form-group
                    lable.col-sm-2.control-lable 豆瓣同步
                    .col-sm-10
                        input#douban.form-control(type="text")
                if movie._id
                    input(type="hidden",name="movie[_id]",value=movie._id)
                .form-group
                    lable.col-sm-2.control-lable(for="inputCatetory") 电影分类
                    .col-sm-10
                        input#inputCatetory.form-control(type="text",name="movie[catetoryName]",value=movie.catetoryName)
                .form-group
                    lable.col-sm-2.control-lable 分类选择
                    each cat in catetories
                        label.radio-inline
                            if movie._id
                                input(type="radio",name="movie[catetory]",value=cat._id,checked=cat._id.toString()==movie.catetory.toString())
                                | #{cat.name}
                            else
                                input(type="radio",name="movie[catetory]",value=cat._id)
                                | #{cat.name}
                .form-group
                    lable.col-sm-2.control-lable(for="inputTitle") 电影名字
                    .col-sm-10
                        input#inputTitle.form-control(type="text",name="movie[title]",value=movie.title)
                .form-group
                    lable.col-sm-2.control-lable(for="inputDoctor") 电影导演
                    .col-sm-10
                        input#inputDoctor.form-control(type="text",name="movie[doctor]",value=movie.doctor)
                .form-group
                    lable.col-sm-2.control-lable(for="inputCountry") 国家
                    .col-sm-10
                        input#inputCountry.form-control(type="text",name="movie[country]",value=movie.country)
                .form-group
                    lable.col-sm-2.control-lable(for="inputLanguage") 语种
                    .col-sm-10
                        input#inputLanguage.form-control(type="text",name="movie[language]",value=movie.language)
                .form-group
                    lable.col-sm-2.control-lable(for="inputPoster") 海报地址
                    .col-sm-10
                        input#inputPoster.form-control(type="text",name="movie[poster]",value=movie.poster)
                .form-group
                    lable.col-sm-2.control-lable(for="uploadPoster") 上传海报
                    .col-sm-10
                        input#uploadPoster(type="file",name="uploadPoster")
                .form-group
                    lable.col-sm-2.control-lable(for="inputFlash") 片源地址
                    .col-sm-10
                        input#inputFlash.form-control(type="text",name="movie[flash]",value=movie.flash)
                .form-group
                    lable.col-sm-2.control-lable(for="inputYear") 上映年代
                    .col-sm-10
                        input#inputYear.form-control(type="text",name="movie[year]",value=movie.year)
                .form-group
                    lable.col-sm-2.control-lable(for="inputSummary") 电影简介
                    .col-sm-10
                        input#inputSummary.form-control(type="text",name="movie[summary]",value=movie.summary)
                .form-group
                    .col-sm-offset-2.col-sm-10
                    button.btn.btn-default(type="submit") 录入
    script(src='../../js/admin.js')
